<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <style>
		.table-list{border:1px solid #dddddd; border-collapse:collapse}
		.table-list td {padding:0;border:1px solid #dddddd;text-align:center;vertical-align:middle;}
		.table-list tr.theader td {font-weight: bold; background-color: #efefef;text-align:left;padding:5px 10px;}
		h2 {text-transform:uppercase; font-size: 180%}
    </style>
</head>
<body>
<h2 align="center">Thống kê tài chính</h2>
<div align="center">Từ ngày <?php echo date('d/m/Y', strtotime($startdate));?> đến ngày <?php echo date('d/m/Y', strtotime($enddate));?></div>
<br /><br />
<table width="100%" cellpadding="3" cellspacing="0" border="0" class="table-list">
    <tr class="theader">
        <td width="30">#</td>
        <td width="170">Tên</td>
        <td>Ngày</td>
        <td>Tiền đã nạp (VND)</td>
        <td>Tiền đã sử dụng (VND)</td>
        <td>Tiền khuyến mại (VND)</td>
    </tr>
   <?php $i = 0; foreach($items as $item){$i++;?>
    <tr>
        <td><?php echo $i;?></td>
        <td><?php echo $item->username;?></td>
        <td><?php echo $item->time;?></td>
        <td><?php echo number_format($item->ad);?></td>
        <td><?php echo number_format($item->sub);?></td>
        <td><?php echo number_format($item->promotion)?></td>
    </tr>
    <?php }?>
    <tr>
        <td colspan="3" align="right">Tổng</td>
        <td><?php echo number_format($summary->ad);?></td>
        <td><?php echo number_format($summary->sub);?></td>
        <td><?php echo number_format($summary->promotion);?></td>
    </tr>
    
</table>
</body>
</html>